package lcr;

public class Test0142 {
}

class Solution0142_1 {
    public ListNode trainningPlan(ListNode l1, ListNode l2) {
        ListNode head = new ListNode(0),curr = head;
        while (l1 != null && l2 != null){
            if (l1.val<l2.val){
                curr.next=l1;
                curr=l1;
                l1=l1.next;
            }else {
                curr.next=l2;
                curr=l2;
                l2=l2.next;
            }
        }

        curr.next=l1==null?l2:l1;

        return head.next;
    }
}
